home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-11 | 11.8 KB | 323 lines | [ttro/ttxt] |
- MT2Trivial, version 1.0b2
- © Copyright by Michael Trofimov, 1996.
- email : mtrofimov@glas.apc.org
- ______________________________________________________
-
- This Drag&Drop utility generates Pascal source from resource
- description file.
-
-
- CONTENTS .
- __________
-
- 1. FILES/FOLDERS LIST.
- 2. ABOUT MT2Trivial.
- 3. AN EXAMPLE.
- 4. WRITING PROGRAMS FROM SCRATCH.
- 5. VERSION HISTORY.
- 6. BUGS REPORTS, COMMENTS ETC.
- 7. COPYRIGHT
- 8. OTHER MT2 SOFTWARE
- 9. ABOUT THE AUTHOR.
-
- 1. FILES/FOLDERS LIST.
- ______________________
-
- "MT2Trivial 1.0b2 ƒ" folder contains the following files and folders:
-
- Read.Me # this file;
- MT2Trivial # the application;
- MainLoop.Trivial # pattern file to generate events related
- # procedures;
- MakeMenu.Trivial # pattern file to generate menu bar support
- # procedures (1);
- MenuComm.Trivial # pattern file to generate menu bar support
- # procedures (2);
- Uses.Trivial # pattern file to generate "uses" list;
-
- "MainLoop.Trivial THINK Pascal" folder contains :
-
- MainLoop.Trivial # pattern file to generate events related
- # procedures for THINK Pascal;
-
- "Example" folder contains :
-
- test.rsrc # an example resource file;
- test.r # resource description file;
- test.p # Pascal source generated by MT2Trivial from
- # "test.r" file;
- test.Dict # dictionary generated by MT2Trivial from
- # "test.r" file for Canon MPW tool;
- test.make # MPW make file for compiling and linking
- # "test.p" and "test.r" under MPW;
- test # the application (produced from the sources
- # "test.p" and "test.r").
-
- 2. ABOUT MT2Trivial.
- _________________
-
- MT2Trivial writes a program, where
-
- -- resources IDs are listed in CONST list;
-
- -- templates of procedures to support some types (DLOG,MENU,WIND,
- etc.) of the resources are introduced;
-
- -- some other templates for standard procedures such as Mac
- managers initialization and event loop, program header and
- program body are appended;
-
- etc.
-
- To generate a name (identifier), MT2Trivial gets comment for
- resource from the resource description. So, to provide readable
- code, you should write comments for each of resources. MT2Trivial
- ignores any character, which is not appropriated for identifier,
- adds letter prefix if resource comment begins from digit and so on.
- But if you dislike a number of such names you are able to use
- test.Dict that is dictionary file for renaming by Canon MPW
- command. To generate procedure templates MT2Trivial uses pattern
- files :
-
- MainLoop.Trivial
- MakeMenu.Trivial
- MenuComm.Trivial
- Uses.Trivial
-
- which look like well-known examples from Inside Macintosh. You can
- modify these files to get necessary result of generation. Also,
- there are another goodies to simplify your programming work. For
- example, MT2Trivial copies Uses template with alphabetical list of
- standard units, you can simply uncomment the necessary of them. You
- can add names of your own units to Uses.Trivial file, etc.
-
- NOTE: There are initializing of the Toolbox in MainLoop.Trivial,
- that is not necessary for THINK Pascal. So, for THINK Pascal
- environment replace the file with "MainLoop.Trivial" file from
- "MainLoop.Trivial THINK Pascal" folder!
-
- MT2Trivial inserts placeholders (commented %%-markers) where
- programmer should insert or modify source code. However, in some
- cases the generated program pattern may be compiled, linked and
- executed successfully (for example, run the test application, which
- was built by test.make file, from test.p gotten from MT2Trivial's
- output as is.) Of course, the test does not make any useful works
- -- it's pattern only, but it's valuable pattern -- it runs without
- run-time errors!
-
- NOTE: MT2Trivial does not generate a code for quitting from the
- program, so the only way to exit from the "test" application
- would be "Opt-Cmd-Esc" keys. The better way is to insert
- a few lines of Pascal code into "test.p" to support Quit item
- in File menu.
-
- By default MT2Trivial generates the most complete source, but for
- some tasks, for example, when your program has been already written
- and you need to insert there additional constant list, the full
- text generation may be too redundant -- too large parts of the text
- you would erase by hand. In similar cases you can suppress
- generation of the parts by option's setting. To help your
- orientation -- which option defines which part generation, the
- parts of generated source begins from comments like this:
-
- {%% MT2Trivial Generation: Main Loop}
-
- NOTE : The number of resources may be used for generation is very
- restricted for current version of MT2Trivial (Not more 32
- resources in resource file is possible).
-
-
- 3. AN EXAMPLE.
- ______________
-
- 1) create myFile.rsrc file by ResEdit;
-
- 2) decompile it via DeRez by Apple Computer, Inc.
- (or via another similar utility) to myFile.r
- resources description file;
-
- 3) drag myFile.r icon by mouse and drop the icon onto
- MT2Trivial icon: you will be prompted about generation
- parameters -- press OK button: MT2Trivial writes myFile.p file.
-
- Now you are able to modify myFile.p for your needs.
-
-
- 4.WRITING PROGRAMS FROM SCRATCH.
- ________________________________
-
- The following software engineering approach may be used:
-
- 1) creation of interface elements : drawing images for resources
- (in graphics editor) and define necessary resources by
- resource editor (ResEdit);
-
- 2) conversion of the resources into resource description file
- (text) via DeRez (SADeRez etc.);
-
- 3) shell code generation by MT2Trivial: generate source code
- of the program to support these resources;
-
- 4) shell code correction, modification and testing :
- the generated interface should work correctly,however the
- generated program is only shell, which supports user's
- interface only (menus, dialogs, windows etc.), but unable
- to do another useful actions (no calculations, no data streams
- treatment... no more): routines for the actions are empty,
- for example:
-
- procedure CalcExpression (s : string);
- begin end;
-
- ................
-
- procedure mainDialog;
- begin
-
- ................
- case selectedDialogItem of
- calcIt: CalcExpression (expression);
- ...................
-
-
- 5) analysis and planning :
- in the result of step 4 we have working model, now we are able
- to list all empty routines (CalcExpression etc.), to write
- specifications for each and (in the case of programming team)
- to define exact tasks for each programmer:
-
- 1st programmer will write CalcExpression
- 2nd programmer will write ......
- ........................
-
- This approach had been tested for different tasks:
-
- CalcWindow - calculator for advanced users : suitable user
- interface; possibility for users to write extensions in popular
- programming language (Pascal,C,C++, etc.); text input/output;
- communications with other programs via Clipboard and Drag
- Manager, etc.
-
- MT2HAPrjDemo - demo-program of Home Account project (co-author:
- Mary Trofimov): money calculations -- day-to-day balance for
- incomes and expenses, multitasking for all members of a family,
- statistic and planning for house keeping, cookery (recipe
- database, menu for current week, diets), CD-ROM support,
- etc. The program won a prize in competition of financial
- programs for house keeping (1C Co., Moscow, Russia 1996).
-
- LogRead - session log interpreter for Glasnet users : beta
- version 1.0b1, and next version 1.2. Now distributed between
- users of Glasnet (Russia).
-
- And of course, this program (see VERSION HISTORY in this file).
-
-
- 5.VERSION HISTORY.
- __________________
-
- May/June, 1996: MT2Trivial, version 1.0b2:
- GUI support procedures of current version of
- MT2Trivial had been generated by Trivial MPW Tool,
- after that generator's procedures from Trivial
- were improved and introduced to MT2Trivial utility.
-
-
- October,1995: Trivial version 1.0b1 MPW tool:
- This MPW Tool was included in MT2Toolkit for
- MPW Pascal programmers.
-
- 6. BUGS REPORTS, COMMENTS ETC.
- ______________________________
-
- Please, send it via email to mtrofimov@glas.apc.org
-
-
- 7. COPYRIGHT
- ____________
-
- Copyright by Michael Trofimov, 1996.
-
- To publish the program, for example, to insert it
- into CD-ROM, please ask the author about permission.
-
- All files listed in "Files/folders list" should be copied as is.
-
-
- 8. OTHER MT2 SOFTWARE
- _____________________
-
- 1. MT2Toolkit
- is tool kit for MPW Pascal programmers. It makes easier a
- variety of permanent programming jobs and so, it's capable to
- save your time and efforts, and, perhaps, to preserve against
- some simple, but wide-distributed bugs.MT2Toolkit may be found
- in many ftp-sites, for example,
-
- nic.switch.ch/mirror/info-mac/dev/lib/mt2-tool-kit-p.hqx
-
- and in Apprentice 4 CD-ROM by Celestin Company, Inc.
- (http://www.celestin.com)
-
- NOTE: MPW Trivial Tool version 1.0b1 is not updated it in this
- toolkit, yet. So, use MT2Trivial utility instead the tool.
- Please, be sure to send your request to mtrofimov@glas.apc.org
- for new version of MPW Trivial Tool if MPW Tool looks like
- more preferable for your purposes than application.
-
- 2.Color Music System Prometheus (shareware):
- makes visual effects for musical playing. A sound signal should
- be load to audio-input of Macintosh (in simple case, the
- source of the signal may be a microphone).
-
- You can find Prometheus-demo in ftp-sites, for example,
-
- mirrors.aol.com/pub/mac/sound/soundutil/prometheus.sit.hqx
-
- and in Info-Mac VII CD-ROM by Pacific HiTech
- (http://www.pht.com)
-
- 3.Color Music System Prometheus Russian version (shareware):
- Read.me file, text in windows and balloon help in Russian.
- Please, send your request to mtrofimov@glas.apc.org to receive it.
-
-
- 9. ABOUT THE AUTHOR.
- ____________________
-
- Michael Trofimov is a computer scientist, chemist and programmer.
- He works in Lab of Computer Chemistry, N.D.Zelinsky Institute of
- Organic Chemistry of Academy of Sci of Russia. Also he makes
- independent researches and commercial programs development.
-
- He works 15 years in computer areas, among his works:
-
- -- Real-time system for ESR spectroscopy;
- -- Scientific program EDIP, to solve index-property problem for
- organic compounds;
- -- Algorithms for applied tasks of graph-theory;
- -- Graphics Library for Extended Pascal compiler,
- (Visible Software Co., DE, USA; Prospero Software Co. UK);
- -- Dr. Pascal integrated environment porting -- from IBM PC to Mac,
- Mac oriented language sensitive editor and interface of Dr.
- Pascal (Visible Software);
- etc.
-
- He is author of more than 50 papers in Russian and international
- journals (First Class; Byte; J.of Pascal, Ada & Modula-2;
- J.of Mathematical Chemistry; etc.).
-
- The MT2Trivial was planned as accumulation of author's experience
- of methods to solve tasks of practical programming. Author uses it
- permanently in his works, and so consequently improves and
- develops it.
-
-
- _____________________________________________________
-
- THANK YOU for your interest to MT2 software,
-
- Michael I. Trofimov.
- ______________________________________________________
-
-